<template>
    <div>
        ({{ time }})
    </div>
</template>
<script setup lang="ts">
import { ref, watch } from 'vue'
let time = ref<number>(60)
let props = defineProps(['flagCode'])
let $emit = defineEmits(['getFlagCode'])
watch(() => props.flagCode, () => {
    let timer = setInterval(() => {
        time.value--
        if (time.value == 0) {
            clearInterval(timer);
            $emit('getFlagCode', false);
        }
    }, 1000)
}, { immediate: true, })
</script>
<style scoped lang="scss"></style>